package com.example.helloworld;

/**
 * ClassName: SumTest
 * Package: com.example.helloworld
 * Description:
 *
 * @Author guotingting
 * @Create 2025/4/21 10:29 AM
 * @Version 1.0
 */
public class SumTest {
    public static void main(String[] args) {
        int [] arr = {1, 2, 3, 4, 5};
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }
        System.out.println("The sum of the array is: " + sum);
        double average = (double) sum / arr.length;
        System.out.println("The average of the array is: " + average);

        long result = 1;
        for (int i = 0; i < arr.length; i++) {
            result *= arr[i];
        }
        System.out.println("The chengji of the array is: " + result);
    }
}
